package com.atguigu.day10.work;

public class Test06 {
    public static void main(String[] args) {
        Worker w = new Worker();
        Apple a1 = new Apple(2, "黄色");
        Apple a2 = new Apple(3, "红色");
        w.pickApple(new CompareAble() {
        }, a1, a2);
        w.pickApple(new CompareAble() {
            @Override
            public void compare(Apple a1, Apple a2) {
                System.out.println("挑红的:");
                if ("红色".equals(a1.getColor())) {
                    System.out.println(a1);
                }
                if ("红色".equals(a2.getColor())){
                    System.out.println(a2);
                }
            }
            },a1,a2);
        }
    }
